/*
 * Coupon.java
 * business
 *
 * Created by ChenTao on 2016/9/9.
 *
 * Copyright (c) 2016年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.data.bean;

import com.google.gson.annotations.SerializedName;

import java.util.List;

/**
 * 优惠券、红包
 */
public class Coupon /*implements Parcelable*/ {

    // 红包id
    @SerializedName("paper_id")
    private String paperId;

    // 红包名字
    @SerializedName("bonus_name")
    private String bonusName;

    // 红包金额
    @SerializedName("money")
    private float money;

    // 优惠券/红包 的相关信息
    @SerializedName("exp")
    private List<String> exp;

    // 是否选中
    @SerializedName("is_select")
    private int isSelected;

    @SerializedName("type")
    private String type;

    @SerializedName("data")
    private String data;

    @SerializedName("extra")
    private String extra;

//
//    public Coupon() {
//    }
//
//    protected Coupon(Parcel in) {
//        this.paperId = in.readString();
//        this.money = in.readFloat();
//        this.bonusName = in.readString();
//        this.exp = in.createStringArrayList();
//    }

//    public boolean isChecked() {
//        return isChecked;
//    }
//
//    public void setChecked(boolean checked) {
//        isChecked = checked;
//    }

    public String getPaperId() {
        return paperId;
    }

    public void setPaperId(String paperId) {
        this.paperId = paperId;
    }

    public float getMoney() {
        return money;
    }

    public void setMoney(float money) {
        this.money = money;
    }

    public String getBonusName() {
        return bonusName;
    }

    public void setBonusName(String bonusName) {
        this.bonusName = bonusName;
    }

    public List<String> getExp() {
        return exp;
    }

    public void setExp(List<String> exp) {
        this.exp = exp;
    }

    public int getIsSelected() {
        return isSelected;
    }

    public void setIsSelected(int isSelected) {
        this.isSelected = isSelected;
    }

//    @Override
//    public int describeContents() {
//        return 0;
//    }
//
//    public static final Creator<Coupon> CREATOR =
//            new Creator<Coupon>() {
//                @Override
//                public Coupon createFromParcel(Parcel source) {
//                    return new Coupon(source);
//                }
//
//                @Override
//                public Coupon[] newArray(int size) {
//                    return new Coupon[size];
//                }
//            };
//
//    @Override
//    public void writeToParcel(Parcel dest, int flags) {
//        dest.writeString(this.paperId);
//        dest.writeFloat(this.money);
//        dest.writeString(this.bonusName);
//        dest.writeStringList(this.exp);
//    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Coupon coupon = (Coupon) o;

        return paperId != null ? paperId.equals(coupon.paperId) : coupon.paperId == null;
    }

    @Override
    public int hashCode() {
        return paperId != null ? paperId.hashCode() : 0;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    public String getExtra() {
        return extra;
    }

    public void setExtra(String extra) {
        this.extra = extra;
    }
}
